/*
 Navicat Premium Data Transfer

 Source Server         : LocalPostgres
 Source Server Type    : PostgreSQL
 Source Server Version : 160002 (160002)
 Source Host           : localhost:5432
 Source Catalog        : axum_sea_orm
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 160002 (160002)
 File Encoding         : 65001

 Date: 23/03/2024 21:55:42
*/


-- ----------------------------
-- Sequence structure for cake_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."cake_id_seq";
CREATE SEQUENCE "public"."cake_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."cake_id_seq" OWNER TO "default";

-- ----------------------------
-- Sequence structure for filling_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."filling_id_seq";
CREATE SEQUENCE "public"."filling_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."filling_id_seq" OWNER TO "default";

-- ----------------------------
-- Sequence structure for fruit_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."fruit_id_seq";
CREATE SEQUENCE "public"."fruit_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."fruit_id_seq" OWNER TO "default";

-- ----------------------------
-- Table structure for cake
-- ----------------------------
DROP TABLE IF EXISTS "public"."cake";
CREATE TABLE "public"."cake" (
  "id" int4 NOT NULL DEFAULT nextval('cake_id_seq'::regclass),
  "name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying
)
;
ALTER TABLE "public"."cake" OWNER TO "default";

-- ----------------------------
-- Records of cake
-- ----------------------------
BEGIN;
INSERT INTO "public"."cake" ("id", "name") VALUES (1, 'New York Cheese');
INSERT INTO "public"."cake" ("id", "name") VALUES (2, 'Chocolate Forest');
COMMIT;

-- ----------------------------
-- Table structure for cake_filling
-- ----------------------------
DROP TABLE IF EXISTS "public"."cake_filling";
CREATE TABLE "public"."cake_filling" (
  "cake_id" int4 NOT NULL,
  "filling_id" int4 NOT NULL
)
;
ALTER TABLE "public"."cake_filling" OWNER TO "default";

-- ----------------------------
-- Records of cake_filling
-- ----------------------------
BEGIN;
INSERT INTO "public"."cake_filling" ("cake_id", "filling_id") VALUES (1, 1);
INSERT INTO "public"."cake_filling" ("cake_id", "filling_id") VALUES (1, 2);
INSERT INTO "public"."cake_filling" ("cake_id", "filling_id") VALUES (2, 2);
INSERT INTO "public"."cake_filling" ("cake_id", "filling_id") VALUES (2, 3);
COMMIT;

-- ----------------------------
-- Table structure for filling
-- ----------------------------
DROP TABLE IF EXISTS "public"."filling";
CREATE TABLE "public"."filling" (
  "id" int4 NOT NULL DEFAULT nextval('filling_id_seq'::regclass),
  "name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying
)
;
ALTER TABLE "public"."filling" OWNER TO "default";

-- ----------------------------
-- Records of filling
-- ----------------------------
BEGIN;
INSERT INTO "public"."filling" ("id", "name") VALUES (1, 'Vanilla');
INSERT INTO "public"."filling" ("id", "name") VALUES (2, 'Lemon');
INSERT INTO "public"."filling" ("id", "name") VALUES (3, 'Mango');
COMMIT;

-- ----------------------------
-- Table structure for fruit
-- ----------------------------
DROP TABLE IF EXISTS "public"."fruit";
CREATE TABLE "public"."fruit" (
  "id" int4 NOT NULL DEFAULT nextval('fruit_id_seq'::regclass),
  "cake_id" int4 NOT NULL DEFAULT 0,
  "name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "public"."fruit" OWNER TO "default";

-- ----------------------------
-- Records of fruit
-- ----------------------------
BEGIN;
INSERT INTO "public"."fruit" ("id", "cake_id", "name") VALUES (1, 1, 'Blueberry');
INSERT INTO "public"."fruit" ("id", "cake_id", "name") VALUES (2, 1, 'Rasberry');
INSERT INTO "public"."fruit" ("id", "cake_id", "name") VALUES (3, 2, 'Strawberry');
COMMIT;

-- ----------------------------
-- Table structure for seaql_migrations
-- ----------------------------
DROP TABLE IF EXISTS "public"."seaql_migrations";
CREATE TABLE "public"."seaql_migrations" (
  "version" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "applied_at" int8 NOT NULL
)
;
ALTER TABLE "public"."seaql_migrations" OWNER TO "default";

-- ----------------------------
-- Records of seaql_migrations
-- ----------------------------
BEGIN;
INSERT INTO "public"."seaql_migrations" ("version", "applied_at") VALUES ('m20240323_033952_create_table_cake', 1711168265);
INSERT INTO "public"."seaql_migrations" ("version", "applied_at") VALUES ('m20240323_034042_create_table_fruit', 1711168265);
INSERT INTO "public"."seaql_migrations" ("version", "applied_at") VALUES ('m20240323_034748_create_table_filling', 1711168265);
INSERT INTO "public"."seaql_migrations" ("version", "applied_at") VALUES ('m20240323_034754_create_table_cake_filling', 1711168265);
COMMIT;

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."cake_id_seq"
OWNED BY "public"."cake"."id";
SELECT setval('"public"."cake_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."filling_id_seq"
OWNED BY "public"."filling"."id";
SELECT setval('"public"."filling_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."fruit_id_seq"
OWNED BY "public"."fruit"."id";
SELECT setval('"public"."fruit_id_seq"', 1, true);

-- ----------------------------
-- Primary Key structure for table cake
-- ----------------------------
ALTER TABLE "public"."cake" ADD CONSTRAINT "cake_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table filling
-- ----------------------------
ALTER TABLE "public"."filling" ADD CONSTRAINT "filling_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table fruit
-- ----------------------------
ALTER TABLE "public"."fruit" ADD CONSTRAINT "fruit_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table seaql_migrations
-- ----------------------------
ALTER TABLE "public"."seaql_migrations" ADD CONSTRAINT "seaql_migrations_pkey" PRIMARY KEY ("version");
